package com.example;

import org.apache.ibatis.annotations.*;


@Mapper
public interface UserMapper {
	
	@Select("SELECT id,user_name,pwd,disabled,expired FROM user WHERE user_name=#{username}")

	@Results({
	@Result(id=true, column="id", property="id"),
	@Result(column="user_name", property="username"),
	@Result(column="disabled", property="disabled"),
	@Result(column="pwd", property="pwd"),
	@Result(column="expired", property="expired"),
	@Result(column="user_name", property="roles",
	many=@Many(select="com.example.RoleMapper.findByUserName"))
	})
	User findByUsername(String username);
	
}
